//member management

function AppWindow1(title) {
	var self = Ti.UI.createWindow({
		title:title,
		id:'w'
	});
	
// HTML を直に指定
var webView2 = Titanium.UI.createWebView( {
    html:    "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><title>jQuery Mobile Test<\/title><style type=\"text/css\">html, body {height:   100%\;margin:   0px\;}#map_canvas {height: 100%\;margin:0px 1px 1px 0px\;}</style><script type=\"text/javascript\" src=\"http:\/\/maps.google.com\/maps\/api\/js\?sensor=false\"><\/script><script type=\"text\/javascript\" src=\"js/map\.js\"><\/script><\/head><body><div id=\"map_canvas\"><\/div><\/body><\/html>"
});

if (Titanium.Platform.osname == 'android') {
    self.activity.onCreateOptionsMenu = function(e) { //(A)
        var menu = e.menu;
        var menuItem1 = menu.add({ title: "about",itemId:1 }); //(B)
        menuItem1.addEventListener(
            "click",
            function(e) {
                var messageWindow = Ti.UI.createWindow(
                    {
                        url: 'AppWindow2.js',
                        title: 'about',
                        icon: 'images/icon_about.png',
                        backgroundColor: '#fff'
                    }
                );
                Ti.UI.currentTab.open(messageWindow);
            }
        );
       var menuItem2 = menu.add({ title: "category",itemId:2 });
        menuItem2.addEventListener(
            "click",
            function(e) {
                var messageWindow = Ti.UI.createWindow(
                    {
                        url: 'AppWindow2.js',
                        title: 'category',
                        icon: 'images/icon_category.png',
                        backgroundColor: '#fff'
                    }
                );
                Ti.UI.currentTab.open(messageWindow);
            }
        );
       var menuItem3 = menu.add({ title: "add_favorite",itemId:3 });
        menuItem3.addEventListener(
            "click",
            function(e) {
                var messageWindow = Ti.UI.createWindow(
                    {
                        url: 'AppWindow2.js',
                        title: 'add_favorite',
                        icon: 'images/icon_add.png',
                        backgroundColor: '#fff'
                    }
                );
                Ti.UI.currentTab.open(messageWindow);
            }
        );
       var menuItem4 = menu.add({ title: "preference",itemId:4 });
        menuItem4.addEventListener(
            "click",
            function(e) {
                var messageWindow = Ti.UI.createWindow(
                    {
                        url: 'AppWindow2.js',
                        title: 'preference',
                        icon: 'images/icon_preference.png',
                        backgroundColor: '#fff'
                    }
                );
                Ti.UI.currentTab.open(messageWindow);
            }
        );
       var menuItem5 = menu.add({ title: "share",itemId:5 });
        menuItem5.addEventListener(
            "click",
            function(e) {
                var messageWindow = Ti.UI.createWindow(
                    {
                        url: 'AppWindow2.js',
                        title: 'share',
                        icon: 'images/icon_share.png',
                        backgroundColor: '#fff'
                    }
                );
                Ti.UI.currentTab.open(messageWindow);
            }
        );
       var menuItem6 = menu.add({ title: "favorite",itemId:6 });
        menuItem6.addEventListener(
            "click",
            function(e) {
                var messageWindow = Ti.UI.createWindow(
                    {
                        url: 'AppWindow2.js',
                        title: 'favorite',
                        icon: 'images/icon_favorites.png',
                        backgroundColor: '#fff'
                    }
                );
                Ti.UI.currentTab.open(messageWindow);
            }
        );
   

    };
}


	
	return self;
};

module.exports = AppWindow1;
